
pkgname=pcre
pkgver=8.42
pkgrel=1
pkgdesc="A library that implements Perl 5-style regular expressions"
arch=('x86_64')
url="https://www.pcre.org/"
license=('BSD')
depends=('gcc-libs' 'readline' 'zlib' 'bzip2' 'libedit')
options=('!libtool')
source=("https://ftp.pcre.org/pub/pcre/${pkgname}-${pkgver}.tar.bz2")
md5sums=('085b6aa253e0f91cae70b3cdbe8c1ac2')

build() {
  cd ${pkgname}-${pkgver}
  
  ./configure --prefix=/usr \
        --enable-utf \
        --enable-unicode-properties \
        --enable-jit \
        --enable-pcre16 \
        --enable-pcre32 \
        --enable-pcregrep-libz \
        --enable-pcregrep-libbz2 \
        --enable-pcretest-libreadline
  make
}

check() {
  cd ${pkgname}-${pkgver} 
  
  make -j1 check
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install

  install -Dm644 LICENCE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
